<template>
  <view class="c">
    <button @click="onAccelerometerChange">onAccelerometerChange</button>
    <button @click="startAccelerometer">startAccelerometer</button>
    <button @click="stopAccelerometer">stopAccelerometer</button>
  </view>
</template>

<script>
export default {
  methods: {
    onAccelerometerChange () {
      uni.onAccelerometerChange(function (event) {
        console.log(event)
      })
    },
    startAccelerometer () {
      uni.startAccelerometer({
        success () {
          console.log('startAccelerometer success')
        },
        fail () {
          console.log('startAccelerometer fail')
        }
      })
    },
    stopAccelerometer () {
      uni.stopAccelerometer({
        success () {
          console.log('stopAccelerometer success')
        },
        fail () {
          console.log('stopAccelerometer fail')
        }
      })
    }
  }
}
</script>

<style>
</style>